package org.kisekiproject.instance {
	import flash.utils.Dictionary;

	/**
	 * @author mikael
	 */
	public class DefinitionLibrary implements IDefinitionLibrary {
		private var _definitions : Dictionary;

		/**
		 * Library of instance definitions.
		 */
		public function DefinitionLibrary() {
			_definitions=new Dictionary();
		}

		/**
		 * Add a definition to the libarary.
		 */
		public function addDefinition(def:InstanceDefinition):void {
			_definitions[def.shortName]=def;
			_definitions[def.fullName]=def;
		}

		/**
		 * Get definition.
		 */
		public function getDefinition(type:String):InstanceDefinition {
			return _definitions[type];
		}
	}
}
